/*Author Rajith Chathunga,
 *		 Computer Science and Engineering,
 *		 University of Moratuwa.
 *
 * Class name : MainQNews
 * 
 *  			
 * This class shows the main interface of this project. It handle the click events of news options 
 * buttons. This class extends Activity and implements onClickListener.*/

package chathunga.qNews;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class MainQNews extends Activity implements OnClickListener {

	Button worldN,sportN,weatherN,travelN,otherN,oky,close;
	static String st;
	TextView title;
	Bundle b = new Bundle();
	
	public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.fws);
        oky=(Button)findViewById(R.id.ok);
        close=(Button)findViewById(R.id.close);
        worldN=(Button)findViewById(R.id.world);
        sportN=(Button)findViewById(R.id.sports);
        weatherN=(Button)findViewById(R.id.weather);
        travelN=(Button)findViewById(R.id.travel);
        otherN=(Button)findViewById(R.id.other);
        oky.setOnClickListener(this);
        close.setOnClickListener(this);
        worldN.setOnClickListener(this);
        weatherN.setOnClickListener(this);
        otherN.setOnClickListener(this);
        sportN.setOnClickListener(this);
        travelN.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		// TODO Auto-generated method stub
		if(v.getId()==R.id.ok){
			
			Intent it= new Intent(this,Option.class);
			startActivity(it);
			finish();

		}
		if(v.getId()==R.id.world){
					
			Intent it= new Intent(this,WorldNews.class);	
			startActivity(it);
			finish();
			
		}
		if(v.getId()==R.id.weather){
			
			Intent it= new Intent(this,WeatherNews.class);				
			startActivity(it);
			finish();
			
		}
		if(v.getId()==R.id.other){
			
			Intent it= new Intent(this,OtherNews.class);	
			startActivity(it);
			finish();
			
		}
		if(v.getId()==R.id.travel){
			
			Intent it= new Intent(this,TravelNews.class);	
			startActivity(it);
			finish();
			
		}
		if(v.getId()==R.id.sports){
			
			Intent it= new Intent(this,SportNews.class);	
			startActivity(it);
			finish();
			
		}
		if(v.getId()==R.id.close){		
	
			this.finish();

		}
		
	}

}
